﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

/* Generated with http://xmltocs.com/ */
namespace EDMXParserV1
{
    public class ReferentialConstraint
    {

        public Principal Principal { get; set; }
        public Dependent Dependent { get; set; }

        public static ReferentialConstraint New(System.Xml.XmlNode Node)
        {
            ReferentialConstraint ReferentialConstraint = new ReferentialConstraint();
            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    default:
                        Globals.AttributeSwitchCoder(Attribute);
                        break;
                }

            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "Principal":
                        ReferentialConstraint.Principal = Principal.New(ChildNode);
                        break;
                    case "Dependent":
                        ReferentialConstraint.Dependent = Dependent.New(ChildNode);
                        break;
                    default:
                        Globals.NodeSwitchCoder(ChildNode);
                        break;
                }
            }

            return ReferentialConstraint;

        }
    }
}
